function collect_same_elements(collection_a, collection_b) {
  //在这里写入代码
  return collection_a.filter((item)=>{
    for(let value of collection_b){
      if(item === value){
        return item ;
      }
    }
  }) ;
}

module.exports = collect_same_elements;
// var collection_a = ["a", "e", "h", "t", "f", "c", "g", "b", "d"];
// var collection_b = ["a", "d", "e", "f"];
// console.log(collect_same_elements(collection_a,collection_b));